// Navigation 导航

// Base
.e-nav {
    $e-nav-padding-x: 1.75rem;
    $e-nav-padding-y: .55rem;

    display: block;
    padding: .5rem 0;
    margin: 0;
    list-style: none;
    border: 0; 
    
    // Item
    .e-nav-item {
        display: block;

        > .e-nav-link {
            display: flex;
            flex-grow: 1;
            align-items: center;
            padding: $e-nav-padding-y $e-nav-padding-x;
            cursor: pointer;
            @include e-transition();

            .e-nav-link-text {
                flex-grow: 1;
                font-size: 1rem;
                color: e-base-color(label, 3);
                font-weight: 400;
            } 
            
            // icon
            .e-nav-link-icon {
                flex: 0 0 30px;
                font-size: 1.25rem;
                line-height: 0;
                color: e-base-color(label, 2);

                &:before {
                    line-height: 0;
                }

                // Svg
                @include e-svg-icon-color(e-base-color(label, 2));
            } 
            
            // 左侧图标
            .e-nav-link-bullet {
                text-align: center;
                flex: 0 0 10px;
                margin-right: 10px;

                > span {
                    vertical-align: middle;
                    display: inline-block;
                }
                // 圆点
                &.e-nav-link-bullet--dot {
                    > span {
                        width: 4px;
                        height: 4px;
                        border-radius: 100%;
                    }
                }
                // 横线
                &.e-nav-link-bullet--line {
                    > span {
                        width: 8px;
                        height: 2px;
                        border-radius: 2px;
                    }
                }

                &.e-nav-link-bullet--line,
                &.e-nav-link-bullet--dot {
                    > span {
                        background-color: e-base-color(label, 1);
                    }
                }
            } 
            
            // 徽章
            .e-nav-link-badge {
                padding: 0 0 0 5px;
            } 
            
            // 箭头
            .e-nav-link-arrow {
                text-align: right;
                flex: 0 0 20px;
                font-size: .8rem;
                color: e-base-color(label, 2);
                @include e-la-icon( e-get($e-action-icons, down));
                &:before {
                    display: inline-block;
                    transition: all .3s ease;
                }
            }

            &.collapsed {
                .e-nav-link-arrow {
                    @include e-la-icon( e-get($e-action-icons, right));
                    &:before {
                        transition: all .3s ease;
                    }
                }
            }
        }
        // 子菜单
        >.e-nav-sub {
            padding: 0;
            margin: 0;

            .e-nav-item {
                >.e-nav-link {
                    padding: .5rem 1.5rem .5rem 2.5rem;
                }
            }
        }

        &.e-nav-item--last {
            padding-bottom: 0;
        }
        
        // Hover & Active 状态
        &.active,
        &:hover:not(.disabled):not(.e-nav-item--sub) {
            >.e-nav-link {
                background-color: e-base-color(grey, 1);

                @include e-transition();
                
                .e-nav-link-icon,
                .e-nav-link-text,
                .e-nav-link-arrow {
                    color: e-state-color(brand, base);
                }

                .e-nav-link-icon {
                    @include e-svg-icon-color(e-state-color(brand, base));
                }
                
                .e-nav-link-bullet {
                    &.e-nav-link-bullet--line,
                    &.e-nav-link-bullet--dot {
                        >span {
                            background-color: e-state-color(brand, base);
                        }
                    }
                }
            }
        } 
        
        // Hover 状态
        &:hover:not(.disabled).e-nav-item--sub {
            >.e-nav-link.collapsed {
                background-color: e-base-color(grey, 1);

                @include e-transition();
                
                .e-nav-link-icon,
                .e-nav-link-text,
                .e-nav-link-arrow {
                    color: e-state-color(brand, base);
                }

                
                
                .e-nav-link-bullet {
                    &.e-nav-link-bullet--line,
                    &.e-nav-link-bullet--dot {
                        >span {
                            background-color: e-state-color(brand, base);
                        }
                    }
                }
            }
        } 
        
        // Disabled 状态
        &.disabled {
            opacity: .6;
        }
    } 

    // Custom
    .e-nav-custom {
        padding:  $e-nav-padding-y $e-nav-padding-x;
    } 
    
    // 分块
    .e-nav-section {
        margin-top: 1rem;
        padding: 0 $e-nav-padding-x;

        .e-nav-section-icon {
            color: e-base-color(label, 1);
        }
        
        &.e-nav-section--first {
            margin-top: 0;
        }
        
        .e-nav-section-text {
            color: e-state-color(brand, base);
            font-weight: 600;
            font-size: .8rem;
            text-transform: uppercase;
        }
    } 
    
    // 分割线
    .e-nav-separator {
        margin: ($e-nav-padding-y + .15rem) 0;
        height: 0;
        display: block;
        border-bottom: 1px solid e-base-color(grey, 2);

        &.e-nav-separator--dashed {
            border-bottom: 1px dashed e-base-color(grey, 2);
        }
    } 
    
    // Head & Foot
    .e-nav-head,
    .e-nav-foot {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 1rem;
        color: e-base-color(label, 3);
        font-weight: 500;
        padding: $e-nav-padding-y $e-nav-padding-x;

        > i {
            font-size: 1.2rem;
            color: e-base-color(label, 2);
        }
    }

    .e-nav-head {
        font-size: 1.1rem;
    }
}